<template>

  <el-dialog title="审核驳回" :visible.sync="$attrs.visableIf" @close="handleCloseDialog" :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="600px">

    <el-form ref="form" :rules="rules" :model="form" label-width="80px">
      <el-form-item label="驳回原因" prop="msg">
        <el-input
          type="textarea"
          placeholder="请输入驳回原因"
          v-model="form.msg"
          maxlength="500"
          show-word-limit
          :rows="6"
        ></el-input>
      </el-form-item>


    </el-form>
    <div class="footer-btn">
      <el-button type="primary" @click="handleCloseDialog">取消</el-button>
      <el-button @click="getReject('form')">提交</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import { reqAccountCheckNotPassData } from '@/api/trafficMasterMgt'

  export default {
    name: 'reject',
    data() {
      return {
        form: {
          msg: null,
          id: this.$attrs.custom_id,//计划id
        },
        rules: {
          'msg': [
            { required: true, message: '请输入驳回的原因', trigger: 'change' }
          ]
        }
      }
    },
    created() {
    },
    mounted() {
    },
    watch: {},
    methods: {
      getReject() {
        this.$modal.confirm(`确定要驳回吗？`).then(() => {
          reqAccountCheckNotPassData(this.form).then(res => {
            this.$modal.msgSuccess('提交成功！');
            this.handleCloseDialog();
            this.$emit('closeParentDialog');
          })

        })
      },
      handleCloseDialog() {
        this.$emit('update:visableIf', false);
        this.$emit('handleQuery');
        this.$emit('getBiglist')//把值传给父级
      }
    }
  }
</script>

<style scoped lang="scss">
::v-deep .el-dialog__body {
  height: auto !important;
}
  .footer-btn {
    display: flex;
    justify-content: flex-end;
  }
</style>
